package pers.lan.array;

import java.util.ArrayList;
import java.util.List;

/**
 * @author <p><a href="mailto:1728209643@qq.com">XiaoSan</a>
 * @date 2019/11/22 2:21 PM
 */
public class LC_315 {

    public List<Integer> countSmaller(int[] nums) {
        List<Integer> list = new ArrayList<>(nums.length);
        for (int i = 0; i < nums.length; i++) {
            int count = 0;
            for (int j = i + 1; j < nums.length; j++) {
                count += nums[j] < nums[i] ? 1 : 0;
            }
            list.add(count);
        }
        return list;
    }
}
